home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / doors_1 / ckit254.zip / CKITDEMO.H < prev    next >
C/C++ Source or Header  |  1992-12-01  |  7KB  |  153 lines

  1. /****************************************************************************
  2.  *   FILE CKITDEMO.H                                                        *
  3.  *   Created 11-FEB-1990            Rickie W. Belitz                        *
  4.  *                                  820 Brentwood Drive                     *
  5.  *                                  Maryville, Tennessee  37801             *
  6.  *                                  BBS (615) 982-6512                      *
  7.  *                                      (615) 982-6537                      *
  8.  *                                      (615) 982-8723                      *
  9.  *                                                                          *
  10.  *                  Parameters that are specific to CKITDEMO                *
  11.  *                                                                          *
  12.  ****************************************************************************/
  13.  
  14.  
  15. /****************************************************************************
  16.  *                   CKITDEMO macros                                        *
  17.  ****************************************************************************/
  18. #define     BELL   0x07
  19. #define     BUFFER_SIZE   2048  /* File Read Buffer */
  20.  
  21. /****************************************************************************
  22.  *      IF IF IF IF IF IF IF IF IF IF IF IF IF IF IF IF IF IF IF IF         *
  23.  ****************************************************************************/
  24. #if COMPILER == MICROSOFT
  25.     #define RAND( seed) (seed = ((( seed * 12) + 6) % (Modulo + 1)))
  26.     int     irandom(short);             /* Generate random number       */
  27.     #define dosopen _dos_open           /* MSC     */
  28.     #define dosread _dos_read
  29.     #define dosclose _dos_close
  30. #else
  31.     #define dosopen _open               /* Turbo C */
  32.     #define dosread _read
  33.     #define dosclose _close
  34. #endif
  35.  
  36. /****************************************************************************
  37.  *     ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF    *
  38.  ****************************************************************************/
  39.  
  40. /****************************************************************************
  41.  *                   CKITDEMO function prototypes                           *
  42.  ****************************************************************************/
  43. void    shut_down(void);      /* Shuts door down if normal or error occurs. */
  44. void    ansi_demo(void);            /* ANSI graphic demo            */
  45. void    display_info(void);         /* Display CKIT information     */
  46. void    take_chance(void);          /* Take a change game           */
  47. void    menu(void);                 /* Main menu for demo           */
  48. void    test_pattern(void);         /* Test pattern                 */
  49. void    filexfer(void);             /* Zmodem file xfer             */
  50. void    zipfile(void);              /* PKZIP shell                  */
  51. void    read_scancode(void);        /* Read key code                */
  52. void    print_msg(short, char **);  /* Print open_door errors       */
  53. void    send_byte(BYTE);            /* Send single byte out remote  */
  54. void    display_time(void);         /* Display XXXX used, XXXX left */
  55. char *  create_buffer(size_t);
  56. short   open_file(char *);
  57. size_t  ck_read_record(short, BYTE *, size_t);
  58. short   parse_to_C(char *, size_t, char **, short);
  59. void    copy_buffer(char *, char **, char *);
  60. short   read_WWIV(void);
  61.  
  62. /****************************************************************************
  63.  *     Set this array equal to your door program name desired               *
  64.  ****************************************************************************/
  65. char    progname[21] = "Ckit - Demo";   /* Program name for status line     */
  66.  
  67. /****************************************************************************
  68.  *     Used in filexfer() in ckitdemo.c                                     *
  69.  ****************************************************************************/
  70. char    doc_filename[9] ="CKIT.DOC";    /* Name for Zmodem xfer             */
  71. char    zip_filename[9] ="CK";          /* Name for PKZIP file              */
  72. char    zmodem_cmds[256];               /* Buffer to build Zmodem command   */
  73. char    dszcmds[128];
  74. char    pkzcmds[128];
  75. char    dos_cmd[] = "COMSPEC";
  76.  
  77. /*****************************************************************************
  78.  *  Create array of pointers to our error messages                           *
  79.  *****************************************************************************/
  80. static  char    *ckit_errors[9] = {
  81. "Error opening system file -> ",
  82. "Error reading system file -> ",
  83. "Unknown BBS file type -> ",
  84. "Error opening users file -> ",
  85. "Invalid User Record in ->",
  86. "Error reading user record -> ",
  87. "Port syntax error: USAGE: PORT:AAAA:X AAAA=COMBASE X=IRQ",
  88. "Fossil driver / DigiBoard driver not installed",
  89. "Unable to allocate memory",
  90.  };
  91.  
  92. /*****************************************************************************
  93.  *  If desired, optional custom log off messages.                            *
  94.  *  If not used, the library will use it's internal defaults.                *
  95.  *****************************************************************************/
  96. char    option0[] = "Normal Quit to BBS msg\n";
  97. char    option1[] = "CARRIER DROPPED! msg\n";
  98. char    option2[] = "Keyboard Timeout msg\n";
  99. char    option3[] = "Sysop return request msg\n";
  100. char    option4[] = "System time expired msg\n";
  101. char    option5[] = "Goobye, hangup msg\n";
  102.  
  103. /*****************************************************************************
  104.  *  If desired, optional general message used.                               *
  105.  *  If not used, the library will use it's internal defaults.                *
  106.  *****************************************************************************/
  107. char    ckmsg0[] = "Screen Display on Message";
  108. char    ckmsg1[] = "Time Adjusted due to event message";
  109. char    ckmsg2[] = "< Press ENTER to Continue > message";
  110. char    ckmsg3[] = "Sysop Chat Active Message";
  111. char    ckmsg4[] = "Sysop Chat End Message";
  112. char    ckmsg5[] = "Sysop Exited to DOS Message";
  113. char    ckmsg6[] = "Sysop Returned from DOS Message";
  114. char    ckmsg7[] = "(Enter=none)?) ";
  115. char    ckmsg8[] = "(Enter=yes) ";
  116. char    ckmsg9[] = "(Enter=no) ";
  117. char    ckmsg10[] = " (Enter) or (Y)es, (N)o, (NS)nonstop? ";
  118. char    ckmsg11[] = "More: ";
  119.  
  120. /*****************************************************************************
  121.  *  Create array of pointers to our custom log off messages                  *
  122.  *****************************************************************************/
  123. static  char    *logoffs[6] = {
  124.     option0,
  125.     option1,
  126.     option2,
  127.     option3,
  128.     option4,
  129.     option5,
  130. };
  131.  
  132. /*****************************************************************************
  133.  *  Create array of pointers to our custom general messages                  *
  134.  *****************************************************************************/
  135. static  char    *ckit_msgs[12] = {
  136.     ckmsg0,
  137.     ckmsg1,
  138.     ckmsg2,
  139.     ckmsg3,
  140.     ckmsg4,
  141.     ckmsg5,
  142.     ckmsg6,
  143.     ckmsg7,
  144.     ckmsg8,
  145.     ckmsg9,
  146.     ckmsg10,
  147.     ckmsg11
  148. };
  149.  
  150. /****************************************************************************
  151.  ************************ E N D  OF  M O D U L E ****************************/
  152.  
  153.